import request from '@/utils/system/request'

/** 登录api */
export function loginApi(data: object) {
  return request({
    url: '/user/user-login',
    method: 'post',
    data
  })
}

/** 获取用户信息Api */
export function getInfoApi(data: object) {
  return request({
    url: '/user/user-info',
    method: 'post',
    data
  })
}

/** 退出登录Api */
export function loginOutApi() {
  return request({
    url: '/user/user-login-out',
    method: 'post',
  })
}

/** 获取用户信息Api */
export function passwordChange(data: object) {
  return request({
    url: '/user/password-change',
    method: 'post',
    data
  })
}

/** 获取登录后需要展示的菜单 */
export function getMenuApi() {
  return request({
    url: `/menu/menu-list`,
    method: 'get',
  })
}

/** 获取验证码 */
export function getCode() {
  return request({
    url: `/user/verify-code`,
    method: 'get',
    responseType:'text'
  })
}

export function createEntity() {
  return request({
    url: '/system/entity',
    method: 'post'
  })
}